import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path:'/',
      name:'/layout',
      component:()=>import('../views/layout/LayoutView.vue'),
      children:[
        {
          path:'/',
          redirect:'/home'
        },
        {
          path:'/home',
          component:()=>import('../views/home/HomeView.vue')
        },
        {
          path:'/cart',
          component:()=>import('../views/cart/CartView.vue')
        },
        {
          path:'/order',
          component:()=>import('../views/order/OrderView.vue')
        },
        {
          path:'/my',
          component:()=>import('../views/my/MyView.vue')
        }
      ]
    },
    {
      path:'/shop',
      component:()=>import('../views/shop/ShopView.vue')
    },
    {
      path:'/address',
      component:()=>import('../views/my/AddressView.vue')
    },
    {
      path:'/createaddress',
      component:()=>import('../views/my/CreateAddressView.vue')
    },
    {
      path:'/orderconfirmation',
      component:()=>import('../views/orderConfirmation/OrderConfirmationView.vue')
    }
  ]
})

export default router
